# 配置文件
# DB_HOST = 'localhost'
# DB_PORT = 3306
# DB_USER='root'
# DB_PASSWORD='root'
# DB_NAME='campus_market'

# 在使用SQLAlchemy框架时，数据库连接配置要写成如下格式：
# app/config.py
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:root@localhost:3306/campus_market'
SQLALCHEMY_TRACK_MODIFICATIONS = False

# 设置一个唯一的秘钥，解决如下问题：
# RuntimeError: The session is unavailable because no secret key was set.  Set the secret_key on the application to something uniq
# ue and secret.
SECRET_KEY="4fdf8d52c908811cbc5d70113103011e"

# import secrets
# print(secrets.token_hex(16))


# 配置文件上传
import os

# 静态文件上传路径
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
UPLOAD_FOLDER = os.path.join(BASE_DIR, 'static', 'uploads', 'avatars')
# 限定上传文件的后缀格式
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}